home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14486 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: news1.intercall.com!usenet
  2. From: engevar@intercall.com (Steven Ovits)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEWBIE input question
  5. Date: Sat, 30 Mar 1996 23:40:06 GMT
  6. Organization: Intercall Inc.
  7. Message-ID: <4jk75f$ae0@news1.intercall.com>
  8. References: <312A0334.AC5@supaero.fr> <4gfg6m$eet@hasle.sn.no> <4hagmf$qc0@donald.interpac.be> <4j5mqr$su7@ohnasn01.sinet.slb.com> <4jc1d6$2tv@news.inc.net> <315A2DA2.716E@oacis.com> <4jeel6$jkm@news.clandjop.com> <zakrzews.828148776@pegasus.montclair.edu> <4jiorp$c61@dfw-ixnews4.ix.netcom.com>
  9. NNTP-Posting-Host: ts2-111.intercall.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. froman@ix.netcom.com(James Edward Sands III ) wrote:
  13.  
  14. >I would like to write a function that lets the user input a certain
  15. >number of a data type, then stop when it gets to the end.
  16. >Such as a zip of 89043
  17. >when the user types the three, the prompt just sits on the three (until
  18. >the enter key is pressed).
  19. >I will be using such a function for user input things like
  20. >state abbreviation (2 char), a zip (five ints), and the sort.
  21. >I have played around using the gotoxy for placement of the cursor
  22. >but have had no success, and unfourtunately the computer I am at
  23. >now is not the one a program on.  Can someone give me any suggestions
  24. >or just even a word or two that might point me in the right directions.
  25.  
  26. >Thanks
  27. >Jim
  28.  
  29. The problem has been "dealt with" by the standards committee.
  30. The problem is that there's no portable way to do this.
  31. The reason is that some systems are networks of terminals that
  32. only communicate at certain times--for example, when you press
  33. the enter key.  This is why C doesn't support the feature. Nor
  34. does it have any loopholes that allow you to hack a solution.
  35.  
  36. You'll need to do this at a systems level. Since you mention
  37. gotoxy(), I'll assume you're using Borland's compiler. They
  38. provide a function called bioskey() that mimics the DOS
  39. keyboard function. If you use it, be careful to check that
  40. it does the right thing--there's an error in Borland's
  41. documentation. If you're using another compiler, check for
  42. a similar function or write the code in assembler using
  43. INT 21h functions.
  44.  
  45.